﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using RTGS.Library.Entities.UserManagement;
using RTGS.Library.DataAccess.UserManagement;
using System.Configuration;

namespace RTGS.Web.form.usermanagement
{
    public partial class sys_t_roleform : BasePage
    {
        private int id = -1;

        private sysTRoleRepo roleDal = new sysTRoleRepo(ConfigurationManager.ConnectionStrings["Rtgs"].ConnectionString);

        protected void Page_Load(object sender, EventArgs e)
        {

            if (Request.Params["Id"] != null)
            {
                id = Convert.ToInt32(Request.Params["Id"]);
            }

            if (!Page.IsPostBack)
            {
                if (id > 0) // Edit an existing item
                {
                    sysTRole obj = roleDal.GetById(id);
                    if (obj != null)
                    {
                        hfID.Value = id.ToString();
                        txtDesc.Text = obj.roleName;
                    }
                }
            }

        }

    }
}
